<h1>Mywiki: Home</h1>
<% if @mywikis.length == 0 %>
	<h5>No pages found.</h5>
	<% else %>
<h3>Last Updated Pages:</h3>
<center>
<table class="mywikiview" border="1" cellpadding="2" cellspacing="0">
  <tr>
    <th>Title</th>
    <th>Description</th>
	<th>CreatedOn</th>
	<th>LastUpdated</th>
	<th>LastAuthor</th>	
  </tr>

<% for mywiki in @mywikis %>
  <tr>
    <td><%=h mywiki.title %></td>
    <td><%=h mywiki.description %></td>    
    <td><%=h mywiki.created_at %></td>    
	<td><%=h mywiki.updated_at %></td>    
	<td>
		<% 	@userid = mywiki.userid
			@user_record = MywikiUser.find(@userid)
			@pageuser = @user_record['user'] %>
	<%=h @pageuser %>
	</td>    
	<td><%= link_to 'View', :controller => 'mywiki', :action => 'view', :f => mywiki.title %></td>
    <td><%= link_to 'Edit', :controller => 'mywiki', :action => 'edit', :f => mywiki.title %></td>
    <td><%= link_to 'Destroy', :confirm => 'Are you sure?', :controller => 'mywiki', :action => 'destroy', :id => mywiki.id %></td>
  </tr>
<% end %>
<% end %>
</table>
</center>
<br />

<%= link_to 'Create New Wiki', :action => 'new' %>

